<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCourseContentsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('course_contents', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->bigInteger('course_id') ->default(0)    ->comment('课程id');
            $table->integer('section_num')  ->default(0)    ->comment('课程章节');
            $table->string('section_name')  ->default(0)    ->comment('章节名称');
            $table->bigInteger('video_id')  ->default(0)    ->comment('章节视频');
            $table->bigInteger('file_id')   ->default(0)    ->comment('章节附件');
            $table->tinyInteger('allow_try')  ->default(0)  ->comment('允许试学');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
//        Schema::dropIfExists('course_contents');
    }
}
